package serie06.util;

/**
 * Modelise le type des pieces de monnaies.
 */
public enum CoinTypes {
	ONE(1), 
	TWO(2), 
	FIVE(5), 
	TEN(10), 
	TWENTY(20), 
	FIFTY(50), 
	ONE_HUNDRED(100), 
	TWO_HUNDRED(200);
	
	private final int value;
	
	CoinTypes(int value) {
		this.value = value;
	}
 
	public int getFaceValue() {
		return value;
	}
	
	public static CoinTypes getCoinTypes(int n) {
		for (CoinTypes c : CoinTypes.values()) {
			if (c.getFaceValue() == n) {
				return c;
			}
		}
		return null;
	}
	
	public String toString() {
		return getFaceValue() + " cts";
	}

}
